package correct.day15;

import java.util.*;
import java.io.*;

public class Test3 {
    public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    public static int n, m;
    public static Map<Integer, List<Integer>> edges = new HashMap<>(); // 存储图
    public static int[] cnt; //统计⼊度信息

    public static void main(String[] args) throws IOException {
        n = in.nextInt();
        m = in.nextInt();
        cnt = new int[n + 1];
        // 1. 建图
        for (int i = 0; i < m; i++) {
            int a = in.nextInt(), b = in.nextInt();
            // a -> b
            cnt[b]++;
            if (!edges.containsKey(a)) {
                edges.put(a, new ArrayList<>());
            }
            edges.get(a).add(b);
        }
        // 2. 拓扑排序
        Queue<Integer> q = new LinkedList<>();
        for (int i = 1; i <= n; i++) {
            if (cnt[i] == 0) {
                q.add(i);
            }
        }
        int[] ret = new int[n]; // 统计拓扑排序的结果
        int pos = 0;
        while (!q.isEmpty()) {
            int t = q.poll();
            ret[pos++] = t;
            for (int a : edges.getOrDefault(t, new ArrayList<>())) {
                cnt[a]--;
                if (cnt[a] == 0) {
                    q.add(a);
                }
            }
        }
        if (pos == n) {
            // 输出结果：输出最后⼀个数的时候，不能有空格
            for (int i = 0; i < n - 1; i++) {
                out.print(ret[i] + " ");
            }
            out.println(ret[n - 1]);
        } else {
            out.println(-1);
        }

        out.close();
    }
}

class Read // ⾃定义快速读⼊
{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }

    String nextLine() throws IOException {
        return bf.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

}
